﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

using CSF.BusinessCore.Data;
using System.ComponentModel;


namespace CSF.Security.Data
{
    /// <summary>
    /// 用户账户数据类
    /// </summary>
    public class UserAccount : Transaction
    {
        #region Database Table Field Mapping members
        [StringLength(50)]
        public string UserName { get; set; }

        [Required]
        [RegularExpression(@"^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$", ErrorMessage = "Your email address does not appear to match the normal format.  Please re-enter. ")]
        [DisplayName("Email address")]
        [DataType(DataType.EmailAddress)]
        [StringLength(50)]
        public string Email { get; set; }

        [StringLength(50)]
        public string Password { get; set; }

        [Required]
        [DisplayName("First Name")]
        [StringLength(50)]
        public string FirstName { get; set; }

        [DisplayName("Last Name")]
        [StringLength(50)]
        public string LastName { get; set; }

        public DateTime? LastActivityDate { get; set; }
        public DateTime? LastLockoutDate { get; set; }
        public DateTime? LastLoginDate { get; set; }
        public DateTime? LastPwdChgDate { get; set; }

        public int PwdAnswerAttemps { get; set; }
        public DateTime? PwdAnswerAttempStart { get; set; }
        public int PwdAttemps { get; set; }
        public DateTime? PwdAttempStart { get; set; }

        [StringLength(255)]
        public string PwdAnswer { get; set; }
        [StringLength(255)]
        public string PwdQuestion { get; set; }
        [StringLength(255)]
        public string Comment { get; set; }

        public bool IsApproved { get; set; }
        public bool IsLockout { get; set; }
        public bool IsDisable { get; set; }
        public bool IsStaff { get; set; }
        public bool IsBuiltin { get; set; }

        public string ApproveBy { get; set; }
        public DateTime? ApproveTime { get; set; }

        #endregion Database Table Field Mapping members
    }




    public class RoleDistribution
    {
        public int Id { get; set; }
        public string Code { get; set; }
        public bool IsCheckCode { get; set; }
        public string Name1 { get; set; }
    }

}
